package com.foreknow.demo6;

public class TestPrinter {
    public static void main(String[] args) {
        Printer p = new ColoreadPrinter();
        p.print();
        Printer p1 = new  BlackwhitePrinter();
        p1.print();

    }
}
class Printer{
    public void print(){
        System.out.println("print");
    }
}
class ColoreadPrinter extends Printer{
    @Override
    public void print(){
        System.out.println("coloreadprint");
    }
}
class BlackwhitePrinter extends Printer{
    @Override
    public void print(){
        System.out.println("blackwhileprint");
    }
}
